<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <title>Zend_Http_Cookie and Zend_Http_CookieJar - Zend Framework Manual</title>

    <link href="../css/shCore.css" rel="stylesheet" type="text/css" />
    <link href="../css/shThemeDefault.css" rel="stylesheet" type="text/css" />
    <link href="../css/styles.css" media="all" rel="stylesheet" type="text/css" />
</head>
<body>
<h1>Zend Framework</h1>
<h2>Programmer's Reference Guide</h2>
<ul>
    <li><a href="../en/zend.http.cookies.html">Inglês (English)</a></li>
    <li><a href="../pt-br/zend.http.cookies.html">Português Brasileiro (Brazilian Portuguese)</a></li>
</ul>
<table width="100%">
    <tr valign="top">
        <td width="85%">
            <table width="100%">
                <tr>
                    <td width="25%" style="text-align: left;">
                    <a href="zend.http.client.adapters.html">Zend_Http_Client - Connection Adapters</a>
                    </td>

                    <td width="50%" style="text-align: center;">
                        <div class="up"><span class="up"><a href="zend.http.html">Zend_Http</a></span><br />
                        <span class="home"><a href="manual.html">Programmer's Reference Guide</a></span></div>
                    </td>

                    <td width="25%" style="text-align: right;">
                        <div class="next" style="text-align: right; float: right;"><a href="zend.http.response.html">Zend_Http_Response</a></div>
                    </td>
                </tr>
            </table>
<hr />
<div id="zend.http.cookies" class="section"><div class="info"><h1 class="title">Zend_Http_Cookie and Zend_Http_CookieJar</h1></div>
    

    <div class="section" id="zend.http.cookies.introduction"><div class="info"><h1 class="title">Introduction</h1></div>
        

        <p class="para">
            <span class="classname">Zend_Http_Cookie</span>, as expected, is a class that represents an
            <acronym class="acronym">HTTP</acronym> cookie. It provides methods for parsing <acronym class="acronym">HTTP</acronym>
            response strings, collecting cookies, and easily accessing their properties. It also
            allows checking if a cookie matches against a specific scenario, IE
            a request <acronym class="acronym">URL</acronym>, expiration time, secure connection, etc.
        </p>

        <p class="para">
            <span class="classname">Zend_Http_CookieJar</span> is an object usually used by
            <span class="classname">Zend_Http_Client</span> to hold a set of
            <span class="classname">Zend_Http_Cookie</span> objects. The idea is that if a
            <span class="classname">Zend_Http_CookieJar</span> object is attached to a
            <span class="classname">Zend_Http_Client</span> object, all cookies going from and into the
            client through <acronym class="acronym">HTTP</acronym> requests and responses will be stored by the
            CookieJar object. Then, when the client will send another request, it will first ask the
            CookieJar object for all cookies matching the request. These will be added to the
            request headers automatically. This is highly useful in cases where you need to
            maintain a user session over consecutive <acronym class="acronym">HTTP</acronym> requests, automatically
            sending the session ID cookies when required. Additionally, the
            <span class="classname">Zend_Http_CookieJar</span> object can be serialized and stored in
            $_SESSION when needed.
        </p>
    </div>

    <div class="section" id="zend.http.cookies.cookie.instantiating"><div class="info"><h1 class="title">Instantiating Zend_Http_Cookie Objects</h1></div>
        

        <p class="para">
            Instantiating a Cookie object can be done in two ways:

            <ul class="itemizedlist">
                <li class="listitem">
                    <p class="para">
                        Through the constructor, using the following syntax:
                        <strong class="command">new <span class="classname">Zend_Http_Cookie</span>(string $name, string
                            $value, string $domain, [int $expires, [string $path, [boolean
                            $secure]]]);</strong>
                    </p>

                    <ul class="itemizedlist">
                        <li class="listitem">
                            <p class="para">
                                <var class="varname">$name</var>: The name of the cookie (eg. &#039;PHPSESSID&#039;)
                                (required)
                            </p>
                        </li>

                        <li class="listitem">
                            <p class="para">
                                <var class="varname">$value</var>: The value of the cookie (required)
                            </p>
                        </li>

                        <li class="listitem">
                            <p class="para">
                                <var class="varname">$domain</var>: The cookie&#039;s domain (eg. &#039;.example.com&#039;)
                                (required)
                            </p>
                        </li>

                        <li class="listitem">
                            <p class="para">
                                <var class="varname">$expires</var>: Cookie expiration time, as UNIX time
                                stamp (optional, defaults to <b><tt>NULL</tt></b>). If not set,
                                cookie will be treated as a &#039;session cookie&#039; with no expiration
                                time.
                            </p>
                        </li>

                        <li class="listitem">
                            <p class="para">
                                <var class="varname">$path</var>: Cookie path, eg. &#039;/foo/bar/&#039; (optional,
                                defaults to &#039;/&#039;)
                            </p>
                        </li>

                        <li class="listitem">
                            <p class="para">
                                <var class="varname">$secure</var>: Boolean, Whether the cookie is to be
                                sent over secure (HTTPS) connections only (optional, defaults to
                                boolean <b><tt>FALSE</tt></b>)
                            </p>
                        </li>
                    </ul>
                </li>

                <li class="listitem">
                    <p class="para">
                        By calling the fromString($cookieStr, [$refUri, [$encodeValue]]) static
                        method, with a cookie string as represented in the &#039;Set-Cookie
                       &#039; <acronym class="acronym">HTTP</acronym> response header or &#039;Cookie&#039; <acronym class="acronym">HTTP</acronym>
                       request header. In this case, the cookie value must already be encoded. When
                       the cookie string does not contain a &#039;domain&#039; part, you must provide a
                       reference <acronym class="acronym">URI</acronym> according to which the cookie&#039;s domain and
                       path will be set.
                    </p>

                    <p class="para">
                        The  <span class="methodname">fromString()</span> method accepts the following
                        parameters:
                    </p>

                    <ul class="itemizedlist">
                        <li class="listitem">
                            <p class="para">
                                <var class="varname">$cookieStr</var>: a cookie string as represented in the
                               &#039;Set-Cookie&#039; <acronym class="acronym">HTTP</acronym> response header or &#039;Cookie&#039;
                               <acronym class="acronym">HTTP</acronym> request header (required)
                            </p>
                        </li>

                        <li class="listitem">
                            <p class="para">
                                <var class="varname">$refUri</var>: a reference <acronym class="acronym">URI</acronym>
                                according to which the cookie&#039;s domain and path will be set.
                                (optional, defaults to parsing the value from the $cookieStr)
                            </p>
                        </li>

                        <li class="listitem">
                            <p class="para">
                                <var class="varname">$encodeValue</var>: If the value should be passed
                                through urldecode. Also effects the cookie&#039;s behavior when being
                                converted back to a cookie string. (optional, defaults to true)
                            </p>
                        </li>
                    </ul>
                </li>
            </ul>

            <div class="example" id="zend.http.cookies.cookie.instantiating.example-1"><div class="info"><p><b>Example #1 Instantiating a Zend_Http_Cookie object</b></p></div>
               

               <pre class="programlisting brush: php">
// First, using the constructor. This cookie will expire in 2 hours
$cookie = new Zend_Http_Cookie(&#039;foo&#039;,
                               &#039;bar&#039;,
                               &#039;.example.com&#039;,
                               time() + 7200,
                               &#039;/path&#039;);

// You can also take the HTTP response Set-Cookie header and use it.
// This cookie is similar to the previous one, only it will not expire, and
// will only be sent over secure connections
$cookie = Zend_Http_Cookie::fromString(&#039;foo=bar; domain=.example.com; &#039; .
                                       &#039;path=/path; secure&#039;);

// If the cookie&#039;s domain is not set, you have to manually specify it
$cookie = Zend_Http_Cookie::fromString(&#039;foo=bar; secure;&#039;,
                                       &#039;http://www.example.com/path&#039;);
</pre>

            </div>

            <blockquote class="note"><p><b class="note">Note</b>: 
                <p class="para">
                    When instantiating a cookie object using the
                    <span class="classname">Zend_Http_Cookie</span>::fromString() method, the cookie value
                    is expected to be <acronym class="acronym">URL</acronym> encoded, as cookie strings should be.
                    However, when using the constructor, the cookie value string is expected to be
                    the real, decoded value.
                </p>
            </p></blockquote>
        </p>

        <p class="para">
            A cookie object can be transferred back into a string, using the __toString() magic
            method. This method will produce a <acronym class="acronym">HTTP</acronym> request &quot;Cookie&quot; header
            string, showing the cookie&#039;s name and value, and terminated by a semicolon (&#039;;&#039;).
            The value will be URL encoded, as expected in a Cookie header:
            <div class="example" id="zend.http.cookies.cookie.instantiating.example-2"><div class="info"><p><b>Example #2 Stringifying a Zend_Http_Cookie object</b></p></div>
               

               <pre class="programlisting brush: php">
// Create a new cookie
$cookie = new Zend_Http_Cookie(&#039;foo&#039;,
                               &#039;two words&#039;,
                               &#039;.example.com&#039;,
                               time() + 7200,
                               &#039;/path&#039;);

// Will print out &#039;foo=two+words;&#039; :
echo $cookie-&gt;__toString();

// This is actually the same:
echo (string) $cookie;

// In PHP 5.2 and higher, this also works:
echo $cookie;
</pre>

            </div>
        </p>
    </div>

    <div class="section" id="zend.http.cookies.cookie.accessors"><div class="info"><h1 class="title">Zend_Http_Cookie getter methods</h1></div>
        

        <p class="para">
            Once a <span class="classname">Zend_Http_Cookie</span> object is instantiated, it provides
            several getter methods to get the different properties of the <acronym class="acronym">HTTP</acronym>
            cookie:

            <ul class="itemizedlist">
                <li class="listitem">
                    <p class="para">
                         <span class="methodname">getName()</span>: Get the name of the cookie
                    </p>
                </li>

                <li class="listitem">
                    <p class="para">
                         <span class="methodname">getValue()</span>: Get the real, decoded value of the
                        cookie
                    </p>
                </li>

                <li class="listitem">
                    <p class="para">
                         <span class="methodname">getDomain()</span>: Get the cookie&#039;s domain
                    </p>
                </li>

                <li class="listitem">
                    <p class="para">
                         <span class="methodname">getPath()</span>: Get the cookie&#039;s path, which defaults
                        to &#039;/&#039;
                    </p>
                </li>

                <li class="listitem">
                    <p class="para">
                         <span class="methodname">getExpiryTime()</span>: Get the cookie&#039;s expiration time,
                        as UNIX time stamp. If the cookie has no expiration time set, will return
                        <b><tt>NULL</tt></b>.
                    </p>
                </li>
            </ul>
        </p>

        <p class="para">
            Additionally, several boolean tester methods are provided:

            <ul class="itemizedlist">
                <li class="listitem">
                    <p class="para">
                         <span class="methodname">isSecure()</span>: Check whether the cookie is set to be
                        sent over secure connections only. Generally speaking, if
                        <b><tt>TRUE</tt></b> the cookie should only be sent over
                        <acronym class="acronym">HTTPS</acronym>.
                    </p>
                </li>

                <li class="listitem">
                    <p class="para">
                         <span class="methodname">isExpired(int $time = null)</span>: Check whether the cookie
                        is expired or not. If the cookie has no expiration time, will always return
                        <b><tt>TRUE</tt></b>. If $time is provided, it will override the
                        current time stamp as the time to check the cookie against.
                    </p>
                </li>

                <li class="listitem">
                    <p class="para">
                         <span class="methodname">isSessionCookie()</span>: Check whether the cookie is a
                        &quot;session cookie&quot; - that is a cookie with no expiration time, which is meant
                        to expire when the session ends.
                    </p>
                </li>
            </ul>
        </p>

        <p class="para">
            <div class="example" id="zend.http.cookies.cookie.accessors.example-1"><div class="info"><p><b>Example #3 Using getter methods with Zend_Http_Cookie</b></p></div>
                

                <pre class="programlisting brush: php">
// First, create the cookie
$cookie =
    Zend_Http_Cookie::fromString(&#039;foo=two+words; &#039; +
                                 &#039;domain=.example.com; &#039; +
                                 &#039;path=/somedir; &#039; +
                                 &#039;secure; &#039; +
                                 &#039;expires=Wednesday, 28-Feb-05 20:41:22 UTC&#039;);

echo $cookie-&gt;getName();   // Will echo &#039;foo&#039;
echo $cookie-&gt;getValue();  // will echo &#039;two words&#039;
echo $cookie-&gt;getDomain(); // Will echo &#039;.example.com&#039;
echo $cookie-&gt;getPath();   // Will echo &#039;/&#039;

echo date(&#039;Y-m-d&#039;, $cookie-&gt;getExpiryTime());
// Will echo &#039;2005-02-28&#039;

echo ($cookie-&gt;isExpired() ? &#039;Yes&#039; : &#039;No&#039;);
// Will echo &#039;Yes&#039;

echo ($cookie-&gt;isExpired(strtotime(&#039;2005-01-01&#039;) ? &#039;Yes&#039; : &#039;No&#039;);
// Will echo &#039;No&#039;

echo ($cookie-&gt;isSessionCookie() ? &#039;Yes&#039; : &#039;No&#039;);
// Will echo &#039;No&#039;
</pre>

            </div>
        </p>
    </div>

    <div class="section" id="zend.http.cookies.cookie.matching"><div class="info"><h1 class="title">Zend_Http_Cookie: Matching against a scenario</h1></div>
        

        <p class="para">
            The only real logic contained in a <span class="classname">Zend_Http_Cookie</span> object, is in
            the match() method. This method is used to test a cookie against a given
            <acronym class="acronym">HTTP</acronym> request scenario, in order to tell whether the cookie should be
            sent in this request or not. The method has the following syntax and parameters:
            <strong class="command">Zend_Http_Cookie-&gt;match(mixed $uri, [boolean $matchSessionCookies, [int
                $now]]);</strong>

            <ul class="itemizedlist">
                <li class="listitem">
                    <p class="para">
                        <var class="varname">$uri</var>: A <span class="classname">Zend_Uri_Http</span> object
                        with a domain name and path to be checked. Optionally, a string representing
                        a valid <acronym class="acronym">HTTP</acronym> <acronym class="acronym">URL</acronym> can be passed
                        instead. The cookie will match if the <acronym class="acronym">URL</acronym>&#039;s scheme (HTTP
                        or <acronym class="acronym">HTTPS</acronym>), domain and path all match.
                    </p>
                </li>

                <li class="listitem">
                    <p class="para">
                        <var class="varname">$matchSessionCookies</var>: Whether session cookies should be
                        matched or not. Defaults to <b><tt>TRUE</tt></b>. If set to
                        <b><tt>FALSE</tt></b>, cookies with no expiration time will never
                        match.
                    </p>
                </li>

                <li class="listitem">
                    <p class="para">
                        <var class="varname">$now</var>: Time (represented as UNIX time stamp) to check a
                        cookie against for expiration. If not specified, will default to the current
                        time.
                    </p>
                </li>
            </ul>

            <div class="example" id="zend.http.cookies.cookie.matching.example-1"><div class="info"><p><b>Example #4 Matching cookies</b></p></div>
                

                <pre class="programlisting brush: php">
// Create the cookie object - first, a secure session cookie
$cookie = Zend_Http_Cookie::fromString(&#039;foo=two+words; &#039; +
                                       &#039;domain=.example.com; &#039; +
                                       &#039;path=/somedir; &#039; +
                                       &#039;secure;&#039;);

$cookie-&gt;match(&#039;https://www.example.com/somedir/foo.php&#039;);
// Will return true

$cookie-&gt;match(&#039;http://www.example.com/somedir/foo.php&#039;);
// Will return false, because the connection is not secure

$cookie-&gt;match(&#039;https://otherexample.com/somedir/foo.php&#039;);
// Will return false, because the domain is wrong

$cookie-&gt;match(&#039;https://example.com/foo.php&#039;);
// Will return false, because the path is wrong

$cookie-&gt;match(&#039;https://www.example.com/somedir/foo.php&#039;, false);
// Will return false, because session cookies are not matched

$cookie-&gt;match(&#039;https://sub.domain.example.com/somedir/otherdir/foo.php&#039;);
// Will return true

// Create another cookie object - now, not secure, with expiration time
// in two hours
$cookie = Zend_Http_Cookie::fromString(&#039;foo=two+words; &#039; +
                                       &#039;domain=www.example.com; &#039; +
                                       &#039;expires=&#039;
                                       . date(DATE_COOKIE, time() + 7200));

$cookie-&gt;match(&#039;http://www.example.com/&#039;);
// Will return true

$cookie-&gt;match(&#039;https://www.example.com/&#039;);
// Will return true - non secure cookies can go over secure connections
// as well!

$cookie-&gt;match(&#039;http://subdomain.example.com/&#039;);
// Will return false, because the domain is wrong

$cookie-&gt;match(&#039;http://www.example.com/&#039;, true, time() + (3 * 3600));
// Will return false, because we added a time offset of +3 hours to
// current time
</pre>

            </div>
        </p>
    </div>

    <div class="section" id="zend.http.cookies.cookiejar"><div class="info"><h1 class="title">The Zend_Http_CookieJar Class: Instantiation</h1></div>
        

        <p class="para">
            In most cases, there is no need to directly instantiate a
            <span class="classname">Zend_Http_CookieJar</span> object. If you want to attach a new cookie
            jar to your <span class="classname">Zend_Http_Client</span> object, just call the
            Zend_Http_Client-&gt;setCookieJar() method, and a new, empty cookie jar
            will be attached to your client. You could later get this cookie jar
            using Zend_Http_Client-&gt;getCookieJar().
        </p>

        <p class="para">
            If you still wish to manually instantiate a CookieJar object, you
            can do so by calling &quot;new Zend_Http_CookieJar()&quot; directly - the
            constructor method does not take any parameters. Another way to
            instantiate a CookieJar object is to use the static Zend_Http_CookieJar::fromResponse()
            method. This method takes two parameters: a <span class="classname">Zend_Http_Response</span>
            object, and a reference <acronym class="acronym">URI</acronym>, as either a string or a
            <span class="classname">Zend_Uri_Http</span> object. This method will return a new
            <span class="classname">Zend_Http_CookieJar</span> object, already containing the cookies set by
            the passed <acronym class="acronym">HTTP</acronym> response. The reference <acronym class="acronym">URI</acronym> will
            be used to set the cookie&#039;s domain and path, if they are not defined in the Set-Cookie
            headers.
        </p>
    </div>

    <div class="section" id="zend.http.cookies.cookiejar.adding_cookies"><div class="info"><h1 class="title">Adding Cookies to a Zend_Http_CookieJar object</h1></div>
        

        <p class="para">
            Usually, the <span class="classname">Zend_Http_Client</span> object you attached your CookieJar
            object to will automatically add cookies set by <acronym class="acronym">HTTP</acronym> responses to
            your jar. if you wish to manually add cookies to your jar, this can be done by using
            two methods:

            <ul class="itemizedlist">
                <li class="listitem">
                    <p class="para">
                        <span class="classname">Zend_Http_CookieJar-&gt;addCookie($cookie[, $ref_uri])</span>:
                        Add a single cookie to the jar. $cookie can be either a
                        <span class="classname">Zend_Http_Cookie</span> object or a string, which will be
                        converted automatically into a Cookie object. If a string is provided, you
                        should also provide $ref_uri - which is a reference <acronym class="acronym">URI</acronym>
                        either as a string or <span class="classname">Zend_Uri_Http</span> object, to use as
                        the cookie&#039;s default domain and path.
                    </p>
                </li>

                <li class="listitem">
                    <p class="para">
                        <span class="classname">Zend_Http_CookieJar-&gt;addCookiesFromResponse($response,
                            $ref_uri)</span>: Add all cookies set in a single
                        <acronym class="acronym">HTTP</acronym> response to the jar. $response is expected to be a
                        <span class="classname">Zend_Http_Response</span> object with Set-Cookie headers.
                        $ref_uri is the request <acronym class="acronym">URI</acronym>, either as a string or a
                        <span class="classname">Zend_Uri_Http</span> object, according to which the cookies&#039;
                        default domain and path will be set.
                    </p>
                </li>
            </ul>
        </p>
    </div>

    <div class="section" id="zend.http.cookies.cookiejar.getting_cookies"><div class="info"><h1 class="title">Retrieving Cookies From a Zend_Http_CookieJar object</h1></div>
        

        <p class="para">
            Just like with adding cookies, there is usually no need to manually
            fetch cookies from a CookieJar object. Your <span class="classname">Zend_Http_Client</span>
            object will automatically fetch the cookies required for an <acronym class="acronym">HTTP</acronym>
            request for you. However, you can still use 3 provided methods to fetch
            cookies from the jar object:  <span class="methodname">getCookie()</span>,
             <span class="methodname">getAllCookies()</span>, and
             <span class="methodname">getMatchingCookies()</span>. Additionnaly, iterating over the
            CookieJar will let you retrieve all the <span class="classname">Zend_Http_Cookie</span> objects
            from it.
        </p>

        <p class="para">
            It is important to note that each one of these methods takes a
            special parameter, which sets the return type of the method. This
            parameter can have 3 values:

            <ul class="itemizedlist">
                <li class="listitem">
                    <p class="para">
                        <b><tt>Zend_Http_CookieJar::COOKIE_OBJECT</tt></b>: Return
                        a <span class="classname">Zend_Http_Cookie</span> object. If the method returns more
                        than one cookie, an array of objects will be returned.
                    </p>
                </li>

                <li class="listitem">
                    <p class="para">
                        <b><tt>Zend_Http_CookieJar::COOKIE_STRING_ARRAY</tt></b>: Return
                        cookies as strings, in a &quot;foo=bar&quot; format, suitable for sending
                        in a <acronym class="acronym">HTTP</acronym> request &quot;Cookie&quot; header. If more than one
                        cookie is returned, an array of strings is returned.
                    </p>
                </li>

                <li class="listitem">
                    <p class="para">
                        <b><tt>Zend_Http_CookieJar::COOKIE_STRING_CONCAT</tt></b>: Similar to
                        COOKIE_STRING_ARRAY, but if more than one cookie is returned, this
                        method will concatenate all cookies into a single, long string
                        separated by semicolons (;), and return it. This is especially useful
                        if you want to directly send all matching cookies in a single
                        <acronym class="acronym">HTTP</acronym> request &quot;Cookie&quot; header.
                    </p>
                </li>
            </ul>
        </p>

        <p class="para">
            The structure of the different cookie-fetching methods is described below:

            <ul class="itemizedlist">
                <li class="listitem">
                    <p class="para">
                        <span class="classname">Zend_Http_CookieJar-&gt;getCookie($uri, $cookie_name[,
                            $ret_as])</span>: Get a single cookie from the jar, according to
                        its <acronym class="acronym">URI</acronym> (domain and path) and name. $uri is either a
                        string or a <span class="classname">Zend_Uri_Http</span> object representing the
                        <acronym class="acronym">URI</acronym>. $cookie_name is a string identifying the cookie
                        name. $ret_as specifies the return type as described above. $ret_type is
                        optional, and defaults to COOKIE_OBJECT.
                    </p>
                </li>

                <li class="listitem">
                    <p class="para">
                        <span class="classname">Zend_Http_CookieJar-&gt;getAllCookies($ret_as)</span>: Get all
                        cookies from the jar. $ret_as specifies the return type as described
                        above. If not specified, $ret_type defaults to COOKIE_OBJECT.
                    </p>
                </li>

                <li class="listitem">
                    <p class="para">
                        <span class="classname">Zend_Http_CookieJar-&gt;getMatchingCookies($uri[,
                            $matchSessionCookies[, $ret_as[, $now]]])</span>: Get all cookies
                        from the jar that match a specified scenario, that is a
                        <acronym class="acronym">URI</acronym> and expiration time.

                        <ul class="itemizedlist">
                            <li class="listitem">
                                <p class="para">
                                    <var class="varname">$uri</var> is either a
                                    <span class="classname">Zend_Uri_Http</span> object or a string
                                    specifying the connection type (secure or non-secure), domain
                                    and path to match against.
                                </p>
                            </li>

                            <li class="listitem">
                                <p class="para">
                                    <var class="varname">$matchSessionCookies</var> is a boolean telling
                                    whether to match session cookies or not. Session cookies are
                                    cookies that have no specified expiration time. Defaults to
                                    <b><tt>TRUE</tt></b>.
                                </p>
                            </li>

                            <li class="listitem">
                                <p class="para">
                                    <var class="varname">$ret_as</var> specifies the return type as
                                    described above. If not specified, defaults to COOKIE_OBJECT.
                                </p>
                            </li>

                            <li class="listitem">
                                <p class="para">
                                    <var class="varname">$now</var> is an integer representing the UNIX time
                                    stamp to consider as &quot;now&quot; - that is any cookies who are set to
                                    expire before this time will not be matched. If not specified,
                                    defaults to the current time.
                                </p>
                            </li>
                        </ul>

                        You can read more about cookie matching in
                        <a href="zend.http.cookies.html#zend.http.cookies.cookie.matching" class="link">this section</a>.
                    </p>
                </li>
            </ul>
        </p>
    </div>
</div>
        <hr />

            <table width="100%">
                <tr>
                    <td width="25%" style="text-align: left;">
                    <a href="zend.http.client.adapters.html">Zend_Http_Client - Connection Adapters</a>
                    </td>

                    <td width="50%" style="text-align: center;">
                        <div class="up"><span class="up"><a href="zend.http.html">Zend_Http</a></span><br />
                        <span class="home"><a href="manual.html">Programmer's Reference Guide</a></span></div>
                    </td>

                    <td width="25%" style="text-align: right;">
                        <div class="next" style="text-align: right; float: right;"><a href="zend.http.response.html">Zend_Http_Response</a></div>
                    </td>
                </tr>
            </table>
</td>
        <td style="font-size: smaller;" width="15%"> <style type="text/css">
#leftbar {
	float: left;
	width: 186px;
	padding: 5px;
	font-size: smaller;
}
ul.toc {
	margin: 0px 5px 5px 5px;
	padding: 0px;
}
ul.toc li {
	font-size: 85%;
	margin: 1px 0 1px 1px;
	padding: 1px 0 1px 11px;
	list-style-type: none;
	background-repeat: no-repeat;
	background-position: center left;
}
ul.toc li.header {
	font-size: 115%;
	padding: 5px 0px 5px 11px;
	border-bottom: 1px solid #cccccc;
	margin-bottom: 5px;
}
ul.toc li.active {
	font-weight: bold;
}
ul.toc li a {
	text-decoration: none;
}
ul.toc li a:hover {
	text-decoration: underline;
}
</style>
 <ul class="toc">
  <li class="header home"><a href="manual.html">Programmer's Reference Guide</a></li>
  <li class="header up"><a href="manual.html">Programmer's Reference Guide</a></li>
  <li class="header up"><a href="reference.html">Zend Framework Reference</a></li>
  <li class="header up"><a href="zend.http.html">Zend_Http</a></li>
  <li><a href="zend.http.client.html">Introduction</a></li>
  <li><a href="zend.http.client.advanced.html">Zend_Http_Client - Advanced Usage</a></li>
  <li><a href="zend.http.client.adapters.html">Zend_Http_Client - Connection Adapters</a></li>
  <li class="active"><a href="zend.http.cookies.html">Zend_Http_Cookie and Zend_Http_CookieJar</a></li>
  <li><a href="zend.http.response.html">Zend_Http_Response</a></li>
  <li><a href="zend.http.user-agent.html">Zend_Http_UserAgent</a></li>
  <li><a href="zend.http.user-agent-device.html">The UserAgent Device Interface</a></li>
  <li><a href="zend.http.user-agent-features.html">The UserAgent Features Adapter</a></li>
  <li><a href="zend.http.user-agent-features-wurfl.html">The WURFL UserAgent Features Adapter</a></li>
  <li><a href="zend.http.user-agent-features-device-atlas.html">The DeviceAtlas UserAgent Features Adapter</a></li>
  <li><a href="zend.http.user-agent-features-tera-wurfl.html">The TeraWurfl UserAgent Features Adapter</a></li>
  <li><a href="zend.http.user-agent-storage.html">The UserAgent Storage Interface</a></li>
  <li><a href="zend.http.user-agent-storage-session.html">The Session UserAgent Storage Adapter</a></li>
 </ul>
 </td>
    </tr>
</table>

<script type="text/javascript" src="../js/shCore.js"></script>
<script type="text/javascript" src="../js/shAutoloader.js"></script>
<script type="text/javascript" src="../js/main.js"></script>

</body>
</html>